Controller

interface Controller

Defines the primary programmatic interface for interacting with and controlling the RevelDigital player engine.

This interface provides access to a wide range of player functionalities, including device information, time management, network operations, event tracking, command execution, peripheral control (like printing and volume), and various listener registration mechanisms for subscribing to player events.

It is often made available within scripting environments (e.g., via a global variable named Controller) to allow dynamic control and interaction with the player during runtime.

Implementations of this interface are expected to be thread-safe if methods can be called from multiple threads, particularly from script execution contexts or asynchronous callbacks.

Author

mtinnes

Since

// Add the version when this controller API was stabilized

See also

Functions

Link copied to clipboard
Registers a ConnectivityListener to receive notifications about changes in the player's internet connectivity status.
Link copied to clipboard
abstract fun addOnBeaconListener(@NonNull listener: OnBeaconListener)
Registers an OnBeaconListener to receive notifications about beacon proximity events.
Link copied to clipboard
Registers an OnCommandListener to receive all commands processed by the player.
Link copied to clipboard
Registers an OnImpressionListener to receive notifications when content generates an impression.
Link copied to clipboard
abstract fun addOnMotionListener(@NonNull listener: OnMotionListener)
Registers an OnMotionListener to receive notifications when motion is detected by the device or connected sensors.
Link copied to clipboard
abstract fun addOnPlayedListener(@NonNull listener: OnPlayedListener)
Registers an OnPlayedListener to receive notifications when media items are played by the player.
Link copied to clipboard
abstract fun addSerialListener(@NonNull listener: SerialListener)
Registers a SerialListener to receive data from connected serial devices.
Link copied to clipboard
abstract fun addTemplateListener(@NonNull listener: TemplateListener)
Registers a TemplateListener to receive notifications about template-related events.
Link copied to clipboard
abstract fun converse(): String
Initiates a voice interaction sequence: records audio from the device's microphone, sends it to a DialogFlow service for processing, and delivers the result asynchronously as a command.
Link copied to clipboard
abstract fun getDevice(): Device
Retrieves detailed information about the physical device and the RevelDigital player application instance currently running.
Link copied to clipboard
abstract fun getDeviceKey(): String
Retrieves the unique identifier (GUID) assigned to this RevelDigital player device.
Link copied to clipboard
abstract fun getDeviceTime(): Date
Gets the current system time of the device, adjusted to the device's configured time zone.
abstract fun getDeviceTime(@NonNull date: Date): Date
Adjusts the supplied Date object to reflect the device's configured time zone.
Link copied to clipboard
Retrieves the most recently processed or issued Command handled by the player.
Link copied to clipboard
abstract fun getOkHttpClient(): OkHttpClient
Returns an OkHttp client instance for making HTTP/HTTPS network calls.
Link copied to clipboard
abstract fun getSchedule(): Schedule
Retrieves the currently active playback schedule for the player.
Link copied to clipboard
abstract fun getTemplate(): Template
Retrieves the currently active template that is scheduled and rendering on the player.
Link copied to clipboard
abstract fun getVersionCode(): Int
Retrieves the version code of the RevelDigital player application.
Link copied to clipboard
abstract fun isConnected(): Boolean
Checks if the player currently has active Internet connectivity.
Link copied to clipboard
Starts a new event session with an automatically generated, unique identifier.
abstract fun newEventSession(@NonNull id: String)
Starts a new event session with a custom, user-provided identifier.
Link copied to clipboard
abstract fun print(@NonNull data: Array<Byte>)
Sends raw byte data directly to the connected USB printer.
abstract fun print(@NonNull text: String, cut: Boolean)
Prints the given text to the connected USB printer, with an option to cut the paper.
Link copied to clipboard
Unregisters a previously added ConnectivityListener.
Link copied to clipboard
Unregisters a previously added OnBeaconListener.
Link copied to clipboard
Unregisters a previously added OnCommandListener.
Link copied to clipboard
Unregisters a previously added OnImpressionListener.
Link copied to clipboard
Unregisters a previously added OnMotionListener.
Link copied to clipboard
Unregisters a previously added OnPlayedListener.
Link copied to clipboard
abstract fun removeSerialListener(@NonNull listener: SerialListener)
Unregisters a previously added SerialListener.
Link copied to clipboard
Unregisters a previously added TemplateListener.
Link copied to clipboard
abstract fun sendCommand(@NonNull name: String, @Nullable arg: String)
Sends a command to the local player engine for processing and dispatches it to all registered OnCommandListener instances.
Link copied to clipboard
abstract fun sendRemoteCommand(@NonNull registrationKeys: Array<String>, @NonNull name: String, @Nullable arg: String)
Sends a command to one or more remote RevelDigital player devices.
Link copied to clipboard
abstract fun setBrightness(level: Int)
Attempts to set the screen brightness for the application's window or the device.
Link copied to clipboard
abstract fun setVolume(level: Int)
Sets the master audio volume for the application.
Link copied to clipboard
abstract fun timeEvent(@NonNull eventName: String)
Starts a timer for a specific event name to measure its duration.
Link copied to clipboard
abstract fun track(@NonNull eventName: String)
Tracks a noteworthy occurrence or user interaction within the application.
abstract fun track(@NonNull eventName: String, @Nullable properties: Map<String, Any>)
Tracks a noteworthy occurrence or user interaction, including custom contextual data.